using Microsoft.Extensions.Configuration;
using System.IO;

namespace Terra.UnitTests.TestBase;

/// <summary>
/// 测试配置帮助类
/// </summary>
public static class TestConfiguration
{
    /// <summary>
    /// 获取测试配置
    /// </summary>
    public static IConfiguration GetConfiguration()
    {
        return new ConfigurationBuilder()
            .SetBasePath(Directory.GetCurrentDirectory())
            .AddJsonFile("appsettings.json", optional: true)
            .AddJsonFile("appsettings.Development.json", optional: true)
            .AddEnvironmentVariables()
            .Build();
    }
}